﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Enterprise.UI.Web.Modules.ZuanjingRb
{
    public partial class ZJRBTJ : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                tb_rq1.Text = "2012-01-01";
                tb_rq2.Text = DateTime.Now.ToString("yyyy-MM-dd");
                bindGrid();
            }
        }

        private void bindGrid()
        {
            Enterprise.Service.GridViewHelper.GvHelper gvhelper = new Service.GridViewHelper.GvHelper();
            string sql = @"select rownum,a.* from(
select t.zjrq,sum(t.zjjc) as zjjc from zjrb t group by t.zjrq ) a where a.zjrq>'"+tb_rq1.Text.Trim()+"' and a.zjrq<='"+tb_rq2.Text.Trim()+"' order by zjrq asc";
            gvhelper.BindData(sql, gv);
        }

        protected void btn_Search_Click(object sender, EventArgs e)
        {
            bindGrid();
        }
    }
}